From ccfe86729e3a454e3fdf529abd7063ceb8fa859f Mon Sep 17 00:00:00 2001
From: Ilion Beyst <ilion.beyst@gmail.com>
Date: Sun, 24 Jul 2022 16:45:29 +0200
Subject: add bot detail page

---
 web/pw-server/src/routes/users/[user_name].svelte | 25 ++++++++---------------
 1 file changed, 9 insertions(+), 16 deletions(-)

(limited to 'web/pw-server/src/routes/users/[user_name].svelte')

diff --git a/web/pw-server/src/routes/users/[user_name].svelte b/web/pw-server/src/routes/users/[user_name].svelte
index fab3a96..a1801f4 100644
--- a/web/pw-server/src/routes/users/[user_name].svelte
+++ b/web/pw-server/src/routes/users/[user_name].svelte
@@ -1,12 +1,4 @@
 <script lang="ts" context="module">
-  function fetchJson(url: string): Promise<Response> {
-    return fetch(url, {
-      headers: {
-        "Content-Type": "application/json",
-      },
-    });
-  }
-
   export async function load({ params, fetch }) {
     const userName = params["user_name"];
     const userBotsResponse = await fetch(`/api/users/${userName}/bots`);
@@ -36,17 +28,17 @@
   <h2>Bots</h2>
   <ul class="bot-list">
     {#each bots as bot}
-    <li class="bot">
-      <span class="bot-name">{bot['name']}</span>
-    </li>
+      <li class="bot">
+        <a class="bot-name" href="/bots/{bot['name']}">{bot["name"]}</a>
+      </li>
     {/each}
   </ul>
 </div>
 
 <style lang="scss">
   .container {
-    min-width: 600px;
-    max-width: 800px;
+    width: 800px;
+    max-width: 80%;
     margin: 50px auto;
   }
 
@@ -56,7 +48,7 @@
   }
 
   .user-name {
-    margin-bottom: .5em;
+    margin-bottom: 0.5em;
   }
 
   .bot-list {
@@ -75,10 +67,11 @@
   .bot-name {
     font-size: 20px;
     font-weight: 400;
+    text-decoration: none;
+    color: black;
   }
 
   .bot:first-child {
     border-top: 1px solid $border-color;
   }
-
-</style>
\ No newline at end of file
+</style>
-- 
cgit v1.2.3

